/*
 * Copyright (c) JoinQuant Development Team
 * Author: Huayong Kuang <kuanghuayong@joinquant.com>
 */

#include <iostream>
#include <time.h>

using namespace std;

string convert_date(struct tm *_time, const char *fmt)
{
    char date[12];
    strftime(date, 11, fmt, _time);

    return string(date);
}

int main(void)
{
    struct tm date = {0};
    date.tm_year = 2021 - 1900;
    date.tm_mon = 11 - 1;
    date.tm_mday = 8;

	cout << convert_date(&date, "%F") << endl;

    return 0;
}

